﻿/**
* 	Canvas
* 	All sprites for a Pants3D object will be rendered to a Canvas object, which should contain only IRenderable children (or subclasses)
* 	@author 	Liam O'Donnell 2008-03-31
**/

package com.spikything.pants3d {
	
	import flash.display.Sprite;
	import flash.geom.Rectangle;

	public class Canvas extends Sprite {

		public function Canvas (width:int, height:int, background:Number=-1) {
			if (width<=2880 && height<=2880) cacheAsBitmap = true;
			if (background>=0) opaqueBackground = background;
			scrollRect = new Rectangle(Math.round(-width/2), Math.round(-height/2), width, height);
		}
		
	}
	
}